Avoid recursion in gtk_css_node_ensure_style()
authorAlexander Larsson <alexl@redhat.com>
Thu, 4 Jun 2020 10:10:31 +0000 (12:10 +0200)
committerAlexander Larsson <alexl@redhat.com>
Thu, 4 Jun 2020 10:10:31 +0000 (12:10 +0200)
commitfc823eb61002d1350305cba6ec718a7c4f6c05e1
tree514d6c47bdb2d360c6dc3a7474826cf7636c88fc
parent36314c3ff7c803d950e9147b9efe471c0c702b1a
Avoid recursion in gtk_css_node_ensure_style()

gtk_css_node_ensure_style() recurses over previous siblings to ensure
these have a style before its following sibling.  As seen in
https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/2027 this can
cause us to stack overflow and crash if we have a lot of children.

And even if we don't have *that* many children its still somewhat
bad to have stack depths of the same magnitude as the number of
children, both for performance reasons and debuggability.
gtk/gtkcssnode.c